<?php
 class widget_login_mini extends CWidget {
	public function run() {
	  $avatar = "";
	  if(!Yii::app()->user->isGuest) {
	    $file_avatar = UserProfile::model()->getAvatar(Yii::app()->user->id);
	    $avatar = Yii::app()->baseUrl."/upload/avatar/thumbs_70x70/".$file_avatar;
	    if($file_avatar==NULL) {
	      $avatar = Yii::app()->baseUrl."/images/no-image.jpg";
	    }
	  }
	  $this->render('widget_login_mini', array('avatar'=>$avatar));
	}
} 
?>